package com.ktjy.crm;

import com.ktjy.crm.model.Role;
import com.ktjy.crm.service.RoleService;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class RoleServiceTester {

    @Resource // 依赖注入
    private RoleService roleService;

    @Test
    public void testInsert() {
        Role role = new Role("ADMIN", "管理员23", 1);
        roleService.insert(role); // 现在不会报 NullPointerException
    }
    @Test
    public void testDelete() {
        roleService.delete(5L);
    }
    @Test
    public void testUpdate() {
        Role role = new Role(4L, "ADMIN", "管理员11    ", 1);
        roleService.update(role);
    }
    @Test
    public void testSelect() {
        Role role = roleService.select();
        System.out.println(role);
    }
}